(function() {
    var docEle = document.documentElement;
    function resizeCalc() {
        docEle.style.fontSize = 100 * (docEle.clientWidth / 640) + "px";
    };
    resizeEvt = "orientationchange" in window? "orientationchange" : "resize";
    window.addEventListener(resizeEvt, resizeCalc);
    document.addEventListener("DOMContentLoaded", resizeCalc);
})();